//
// Created by Administrator on 2021/8/23.
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <climits>

using namespace std;

class Solution {
public:
    static constexpr int MOD = 1'000'000'007;

    int numMusicPlaylists(int n, int l, int k) {
        vector<vector<int>> dp(l + 1, vector<int>(n + 1, 0));
        dp[0][0] = 1;
        for (int i = 1; i <= l; ++i) {
            for (int j = 1; j <= min(l, n); ++j) {
                dp[i][j] = 1L * dp[i - 1][j - 1] * (n - j + 1) % MOD +
                           1L * dp[i - 1][j] * (max(0, j - k)) % MOD;
                dp[i][j] %= MOD;
            }
        }
        return dp[l][n];
    }
};

int main() {
    Solution solution;
    cout << solution.numMusicPlaylists(16, 16, 4) << endl;
    return 0;
}
